package com.zoe.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zoe.app.dao.RoleMapper;
import com.zoe.app.entity.Menu;
import com.zoe.app.entity.Role;
import com.zoe.app.service.MenuService;
import com.zoe.app.service.RoleService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author zbg
 * @date 2024/02/27
 * @description $description
 */
@Service
@RequiredArgsConstructor
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    private final MenuService menuService;

    @Override
    public boolean saveRoleAndMenu() {
        Role role = new Role();
        role.setName("test");
        role.setNamezh("测试");
        save(role);
        Menu menu = new Menu();
        menu.setPattern("saaaa");
        return menuService.save(menu);
    }
}
